import { createRouter, createWebHistory } from 'vue-router';
import Login from '@/views/Login.vue';
import Home from '@/views/Home.vue';
import Register from '@/views/Register.vue';
import Layout from '@/components/Layout.vue';
const router = createRouter({
    history: createWebHistory(),
    routes: [
        {
            path: '/',
            redirect: '/login',
            component: Layout,
            children: [
                {
                    path: 'home',
                    component: Home,
                },
                {
                    path: 'my',
                    component: () => import('@/views/My.vue'),
                },
                {
                    path: 'shop',
                    component: () => import('@/views/Shop.vue'),
                },
                {
                    path: 'category',
                    component: () => import('@/views/Category.vue'),
                },
            ]
        },
        {
            path: '/login',
            component: Login,
        },
        {
            path: '/register',
            component: Register,
        },
        {
            path: '/prodInfo',
            component: () => import("@/views/prodInfo.vue"),
        },
        {
            path: '/order',
            component: () => import("@/views/Order.vue"),
        },
        {
            path: '/addressList',
            component: () => import("@/views/Address.vue"),
        },
        {
            path: '/myorder',
            component: () => import("@/views/myOrder.vue"),
        },
    ]
})
export default router;